#include "MyString.h"
#include <stdio.h>
#include <string.h>

void InitString(MyStr *s)
{
    s->len = 0;
    memset(s->str, 0, Size);
}

// 替代原来的字符串
void InsertStr(MyStr *s, const char *newStr)
{
    int slen = strlen(newStr);
    s->len = Size - 1 > slen ? slen : Size - 1;
    strncmp(s->str, newStr, Size - 1);
}

void PrintSter(MyStr *s,bool HaveEnter)
{
    if(HaveEnter)
    printf("%s\n",s->str);
    else
    printf("%s",s->str);
}

void APPendStr(MyStr *s,const char *newStr);
{
    strcat(s->str,newStr,Size-1-s->len);
    s->len= strlen(s->str);
    
}

void RemoveString(MyStr *s, const char *str)
{
    char *dest = strstr(s->str,str);
    while(dest!=NULL)
    {
        char *back = dest + strlen(str);
        while(*back!='\0')
        *dest++=*back++;
        *dest='\0';
        dest=strstr(s->)
    }
}


bool IsStrEqual(MyStr *s,MyStr *str);
{
    return strcmp(s->str,str->str)==0;
}


char *GetsPtr(MyStr *s)
{
    return s->str;
}

void GetStr(MyStr *s)
{
    InitMyString(s);
    char c=0;
    while((c= getchar())!='\n'&& s->len < Size-1)
    {
        s->str[s->len++]=c;
    }
}